package com.wq.jdk8;

/**
 * @Author: wangqiang20995
 * @Date:2019/4/2
 * @Description:
 * @Resource:
 */
public class ClassAPI {

    public static void main(String[] args){
        ClassAPI classAPI = new ClassAPI();
        classAPI.show(new Runnable() {
            @Override
            public void run() {
                System.out.println("hello");
            }
        });
        //lamda表达式，产生的类并不是匿名类
        classAPI.show(() -> System.out.println("hello"));
    }

    void show(Runnable runnable){
        System.out.println(runnable.getClass());
        System.out.println("isAnonymousClass:" + runnable.getClass().isAnonymousClass());
        System.out.println("sub class of Object.class -> " + Object.class.isAssignableFrom(runnable.getClass()));
    }
}
